<template>
  <div class="left-chart-2">
    <div class="lc2-header">报警类型</div>
    <div class="chart" id="chart">
      <!-- <ve-pie :data="chartData" :settings="chartSettings"  :extend="chartExtend"></ve-pie> -->
      <ve-ring :settings="chartSettings" :data="chartData" :extend="chartExtend" height="100%"></ve-ring>
    </div>
  </div>
</template>
<script>
// import elementResizeDetectorMaker from "element-resize-detector";
export default {
  name: 'LeftChart2',
  data () {
    this.chartExtend = {
      series: {
        center: ['50%', '60%']
      },
      legend: {
        // orient: 'vertical',
        x: 'left',
        top: '3%',
        left: '2',
        textStyle: {
          color: '#fff',
          fontSize: '10'
        }
      }
    }
    this.chartSettings = {
      radius: ['30%', '50%'],
      legend: {
        textStyle: {
          color: '#fff',
          orient: 'vertical'
        }
      },
      textStyle: {
        fontSize: 28
      }
    }
    return {
      chartData: {
        columns: ['name', 'value'],
        rows: [
          { name: '高温报警', value: 93 },
          { name: '前向碰撞报警', value: 32 },
          { name: '车道偏移报警', value: 65 },
          { name: '胎压报警', value: 44 },
          { name: '司机疲劳报警', value: 52 }
        ]
      }
    }
  }
}
</script>

<style lang="less">
.left-chart-2{
   background: url(./img/panel.png) center no-repeat;
  background-size: 100% 100%;
}
  .lc2-header {
    height: 20px;
    color: #fff;
    line-height: 20px;
    font-size: 16px;
    text-indent: 20px;
    margin-top: 10px;
  }
  .chart {
    width: 100%;
    height: calc(100% - 30px);
  }
  .lc2-details {
    height: 40px;
    font-size: 16px;
    display: flex;
    align-items: center;
    text-indent: 20px;

    span {
      color: #096dd9;
      font-weight: bold;
      font-size: 35px;
      margin-left: 20px;
    }
  }

  .lc2-chart {
    height: calc(~"100% - 80px");
  }
</style>
